import { Module, forwardRef } from '@nestjs/common';
import { PollService } from './poll.service';
import { PollController } from './poll.controller';
import { TypeOrmModule } from '@nestjs/typeorm';
import { Poll } from '../../entities/poll.entity';
import { AuthModule } from '../../core/auth/auth.module';
import { CommonModule } from '../../common/common.module';
import { PassportModule } from '@nestjs/passport';
import { VoteRecord } from '../../entities/vote-record.entity';
import { Singer } from '../../entities/singer.entity';
import { Post } from '@/entities/post.entity';

@Module({
  imports: [
    TypeOrmModule.forFeature([Poll, VoteRecord, Singer, Post]),
    forwardRef(() => AuthModule), // 处理相互循环依赖
    CommonModule,
    PassportModule,
  ],
  controllers: [PollController],
  providers: [PollService],
  exports: [PollService],
})
export class PollModule {}
